package com.suray.type;

/**
 * 6代车控制模式
 */
public enum Rgv60Mode {
    INVALID(-1, "无效"),
    STAND_ALONE(0, "单机模式"),
    DISPATCH(1, "WCS控制模式"),
    ;

    Integer value;
    String des;
    Rgv60Mode(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public Integer getValue() {
        return value;
    }

    public static Rgv60Mode parseMode(Integer value) {
        if (value == null) {
            return INVALID;
        }

        for (Rgv60Mode mode : Rgv60Mode.values()) {
            if (mode.value.equals(value)) {
                return mode;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
